package com.haredot.controller;

import com.haredot.entity.Comments;
import com.haredot.service.CommentsService;
import com.haredot.vo.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/comment")
public class CommentController {

    @Resource
    private CommentsService commentsService ;
    /**
     * 添加评论
     * @return
     */
    @PostMapping
    public R<?> comments(@RequestBody @Valid Comments comments) {

          return commentsService.saveComments(comments);
    }
}
